package org.quickjsf.core.base.service;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

import org.hibernate.criterion.Criterion;
import org.quickjsf.core.base.dao.PageModel;
import org.quickjsf.core.base.viewmodel.vo.FieldFilter;

public interface IBaseService<T> {

	public abstract void remove(T entity);
	
	public void removeAll(Collection<T> entities);

	public abstract T getById(Serializable id);
	
	public T fetchAllById(final Serializable id);

	public abstract List<T> getAll();

	public abstract Serializable save(T entity);

	public abstract void update(T entity);
	
	public abstract PageModel<T> getTableList(final int first, final int pageSize, final String sortField, final String sortName, final List<Criterion> criterions);

	public abstract PageModel<T> getTableFilterList(int first, int pageSize, String sortField, String sortName, List<FieldFilter> fieldFilters);

}